package tech.aistar.prj.service.impl;

import org.apache.ibatis.session.SqlSession;
import tech.aistar.prj.entity.PetType;
import tech.aistar.prj.mapper.PetTypeMapper;
import tech.aistar.prj.service.IPetService;
import tech.aistar.prj.service.IPetTypeService;
import tech.aistar.prj.util.MybatisUtil;

import java.util.List;

/**
 * 本类功能:
 *
 * @author cxylk
 * @date 2020/9/17 17:52
 */
public class PetTypeServiceImpl implements IPetTypeService{
    @Override
    public List<PetType> getAll() {
        SqlSession sqlSession= MybatisUtil.getSqlSession();
        PetTypeMapper petTypeMapper=sqlSession.getMapper(PetTypeMapper.class);
        List<PetType> petTypes=petTypeMapper.findAll();
        sqlSession.close();
        return petTypes;
    }
}
